<script setup name="PopupDialog">
import { ref, defineExpose} from 'vue'
const props = defineProps({
  title: {
    type: String,
    default: ''
  },
  confirm: Function
})
const popupRef = ref(null)
const open = () => {
  popupRef.value?.open()
}
const close = () => {
  popupRef.value?.close()
}
defineExpose({
  open,
  close
})
</script>
<template>
  <uni-popup ref="popupRef" type="dialog">
    <uni-popup-dialog :title="title" before-close type="info" :duration="2000" @close="close" @confirm="confirm">
      <slot></slot>
    </uni-popup-dialog>
  </uni-popup>
</template>

<style scoped lang="scss">

</style>
